import Vue from 'vue'
import Router from 'vue-router'
import Signin from '@/components/Signin/index'
//import Home from '@/components/Home/Home'
// 异步加载模块
// import Home from '@/component/Home/Home'
const Home = () => import(/* webpackChunkName: "Home" */ '@/components/Home/Home')

Vue.use(Router)

export default new Router({
  routes: [
  		{
  			path:'/',
  			redirect:'/home'
  		},
     {
       path: '/signin',
       component: Signin,
       name: 'signin'
     },
     {
       path: '/home',
       component: Home,
       name: 'home',
       children: [
       	{
       		path:'System',
       		component: ()=>import(/* webpackChunkName:"System"*/ '@/components/System/System'),
       		name:'系统管理',
       		            children: [
              {
                path: 'AccountManage',
                component: ()=>import(/* webpackChunkName:"AccountManage"*/ '@/components/System/AccountManage/AccountManage'),
                name: '用户管理',
                children: [
                  { 
                    path: 'AddNewUser',
                    component: ()=>import(/* webpackChunkName:"AddNewUser"*/ '@/components/System/AccountManage/AddNewUser'),
                    name: '新增用户'
                  }
                ]
              },
              {
                path: 'PermissionManage',
                component: ()=>import(/* webpackChunkName:"PermissionManage"*/ '@/components/System/PermissionManage/PermissionManage'),
                name: '权限管理' 
              },
              {
                path: 'RoleManage',
                component: ()=>import(/* webpackChunkName:"RoleManage"*/ '@/components/System/RoleManage/RoleManage'),
                name: '角色管理' 
              }
            ]
      
       	}
       ]
     }
  ]
})
